package com.micrometa.km.ui.skins;

import org.pushingpixels.substance.api.ComponentState;
import org.pushingpixels.substance.api.DecorationAreaType;
import org.pushingpixels.substance.api.SubstanceColorScheme;
import org.pushingpixels.substance.api.SubstanceColorSchemeBundle;
import org.pushingpixels.substance.api.SubstanceSkin;
import org.pushingpixels.substance.api.colorscheme.LightGrayColorScheme;
import org.pushingpixels.substance.api.colorscheme.MetallicColorScheme;
import org.pushingpixels.substance.api.colorscheme.OrangeColorScheme;
import org.pushingpixels.substance.api.painter.border.ClassicBorderPainter;
import org.pushingpixels.substance.api.painter.decoration.ArcDecorationPainter;
import org.pushingpixels.substance.api.painter.fill.GlassFillPainter;
import org.pushingpixels.substance.api.painter.highlight.GlassHighlightPainter;
import org.pushingpixels.substance.api.shaper.ClassicButtonShaper;

public class CustomSkin extends SubstanceSkin {
	@Override
	public String getDisplayName() {
		return "Custom";
	}

	public CustomSkin() {
		SubstanceColorScheme activeScheme = new OrangeColorScheme().shade(
				0.2).invert();
		SubstanceColorScheme enabledScheme = new MetallicColorScheme();
		SubstanceColorScheme disabledScheme = new LightGrayColorScheme();

		SubstanceColorSchemeBundle defaultSchemeBundle = new SubstanceColorSchemeBundle(
				activeScheme, enabledScheme, disabledScheme);
		defaultSchemeBundle.registerHighlightColorScheme(activeScheme,
				0.6f, ComponentState.ROLLOVER_UNSELECTED);
		defaultSchemeBundle.registerHighlightColorScheme(activeScheme,
				0.8f, ComponentState.SELECTED);
		defaultSchemeBundle.registerHighlightColorScheme(activeScheme,
				0.95f, ComponentState.ROLLOVER_SELECTED);
		defaultSchemeBundle.registerHighlightColorScheme(activeScheme,
				0.8f, ComponentState.ARMED, ComponentState.ROLLOVER_ARMED);
		this.registerDecorationAreaSchemeBundle(defaultSchemeBundle,
				DecorationAreaType.NONE);

		SubstanceColorSchemeBundle headerSchemeBundle = new SubstanceColorSchemeBundle(
				activeScheme.saturate(0.3), activeScheme, disabledScheme);
		this.registerDecorationAreaSchemeBundle(headerSchemeBundle,
				headerSchemeBundle.getActiveColorScheme(),
				DecorationAreaType.PRIMARY_TITLE_PANE,
				DecorationAreaType.SECONDARY_TITLE_PANE,
				DecorationAreaType.HEADER);

		this.borderPainter = new ClassicBorderPainter();
		this.fillPainter = new GlassFillPainter();
		this.buttonShaper = new ClassicButtonShaper();
		this.decorationPainter = new ArcDecorationPainter();
		this.highlightPainter = new GlassHighlightPainter();

		this.selectedTabFadeStart = 1.0f;
		this.selectedTabFadeEnd = 1.0f;
	}
}
